#include <iostream>
using namespace std;

int main() {
  int n = 0;
  cin >> n;
	long fact = 1; // 阶乘
  long sum = 0;
  for(int i = 1; i <= n; ++i) {
    fact *= i;
    sum += fact;
  }
  cout << sum << endl;
  return 0;
}